<?php
include("../inc/conn.inc");
include("../cache/cache.php");
$hover=2;
$rs=mysql_query("select id,hot_name,hot_id,hot_is_num,hot_num from hot_product where id=".$_GET['id']);
$row=mysql_fetch_array($rs);
$hot_num=$row[hot_is_num]?$row[hot_num]:15;
$pagesize=15;
$p  = $curr_page = intval($_GET['p'])?intval($_GET['p']):1;
$rs2=mysql_query("select id,hot_name from hot_product where id='$row[hot_id]'");
$row2=mysql_fetch_array($rs2);
$rs3=mysql_query("select id,city_name,city_id from city where id='$_GET[did]'");
$row3=mysql_fetch_array($rs3);
$city = include(PHPCMS_ROOT.'city.php');

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?=$row3['city_name']?><?=$row['hot_name']?>，<?=$row3['city_name']?><?=$row['hot_name']?>价格，<?=$row3['city_name']?><?=$row['hot_name']?>产品列表，热点产品</title>
<meta name="description" content="三帝贸易网热点产品目录为您提供<?=$row3['city_name']?><?=$row['hot_name']?>，<?=$row3['city_name']?><?=$row['hot_name']?>价格，<?=$row3['city_name']?><?=$row['hot_name']?>生产厂家、<?=$row3['city_name']?><?=$row['hot_name']?>，最新<?=$row3['city_name']?><?=$row['hot_name']?>产品列表。" />
<meta name="keywords" content="<?=$row3['city_name']?><?=$row['hot_name']?>，<?=$row3['city_name']?><?=$row['hot_name']?>价格，<?=$row3['city_name']?><?=$row['hot_name']?>产品列表，热点<?=$row3['city_name']?><?=$row['hot_name']?>产品，热点产品" />
<link href="/css/body.css" rel="stylesheet" type="text/css" />
<link href="/css/link.css" rel="stylesheet" type="text/css" />
<link href="/css/head.css" rel="stylesheet" type="text/css" />
<link href="/hot-pro/css/page.css" rel="stylesheet" type="text/css" />
<link href="/hot-pro/css/prolist.css" rel="stylesheet" type="text/css" />
<link href="/css/foot.css" rel="stylesheet" type="text/css" />

<style type="text/css">
<!--
.aa {
	font-size: 16px;
	font-weight: bold;
	color: #0033CC;
}
-->
</style>

</head>
<body>
<?php include("../inc/head_top.php")?>
<?php include("../inc/index_search.php")?>
<?php include("../inc/menu.php");?>
<div id="mian" class="topside6 side">
<div class="title"><span><b><a href="http://www.sandib2b.cn/about/hotad.php" target="_blank">我想在这出现</a></b></span>您所在的位置：<a href="/">首页</a> >> <a href="/hot-pro/">热点产品</a> >> <a href="/hot/type-tid<?=$row2[id]?>.html"><?=$row2['hot_name']?></a> >> <a href="/hot/<?=$_GET[type_name]?>-cid<?=$_GET[id]?>.html"><?=$row['hot_name']?></a> >> <?=$row3['city_name']?><?=$row['hot_name']?></div>
<div class="onl"></div>
</div>
<div class="w960 topside20 downside20 side">
<script type="text/javascript">/*960*90，创建于2011-3-9*/ var cpro_id = 'u403357';</script><script src="http://cpro.baidu.com/cpro/ui/c.js" type="text/javascript"></script>
<div class="onl"></div>
</div>
<div id="mian" class="topside6">
<script type="text/javascript">
/*960*80，创建于2013-7-4*/
var cpro_id = "u1313438";
</script>
<script src="http://cpro.baidustatic.com/cpro/ui/c.js" type="text/javascript"></script>
</div>
<div id="mian" class="topside6 side" align="center">
<script type="text/javascript"><!--
google_ad_client = "ca-pub-2924453545159453";
/* 728x90, 创建于 11-3-18 */
google_ad_slot = "0531157620";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<div class="onl"></div>
</div>
<div id="mian" class="topside6 side">
<div class="title1"><b><?=$row3['city_name']?><?=$row['hot_name']?></b><br />

<font style="color:red;font-size:14px;">
&nbsp;&nbsp;&nbsp;&nbsp;您的"<?=$row['hot_name']?>"商品信息还没在这里展示吗？ <span style="color:#000000;font-size:12px">升级为钻石会员，您的商品信息就会在页面优先展示，排名靠前! </span>
<br />
<span style="color:#000000;font-size:12px">&nbsp;&nbsp;&nbsp;&nbsp;加入钻石会员：请<a href="http://sandib2b.cn/about/contact.php" target="_blank">联系我们</a></span></font><br />
<br />

<b><?=$row3['city_name']?><?=$row['hot_name']?>产品列表</b></div>
<ul class="probox">
<?php 
//"select id,picture,m_type,p_title,catalog_id1,catalog_1,catalog_id2,catalog_2 from hot_pro_list  where  p_title like '%".$row['hot_name']."%' group by member_id order by m_type desc limit ".$hot_num

	$cache_name = "cache_hot_".$_GET['id'];
	$cache_time = 3600*24*0.5;
	$data = S($cache_name,'',null,'',array('temp'=>'../cachefile/hot/'));
	$offset = ($p-1)*$pagesize;
	if(!$data)
	{
		$h_rs=mysql_query("select id,member_id,picture,m_type,p_title,catalog_id1,catalog_1,catalog_id2,catalog_2 from hot_pro_list  where olddata=1 and  p_title like '%".$row['hot_name']."%' group by member_id order by m_type  desc  limit ".$offset.' , '.$hot_num);
		while($h_row=mysql_fetch_array($h_rs)){
			$olddata[]=$h_row;
		}

		$n_rs=mysql_query("select id,member_id,picture,m_type,p_title,catalog_id1,catalog_1,catalog_id2,catalog_2 from hot_pro_list  where olddata=0 and catalog_id3=".$_GET["id"]." group by member_id order by id  desc limit ".$offset.' , '.$hot_num);
		while($n_row=mysql_fetch_array($n_rs)){
		$newdata[]=$n_row;
		}
		if($newdata && $olddata)
		{
			$data=array_merge($newdata,$olddata);
		}
		else if($newdata)
		{
			$data=$newdata;
		}
		else if($olddata)	
		{
			$data=$olddata;
		}
		else
		{
			$data = array();
		}

		S($cache_name,$data,$cache_time,'',array('temp'=>'../cachefile/hot/'));
	}


	if($row['hot_id']==0)
	{
		$where = " catalog_id2 = $_GET[id]";
	}
	else
	{
		$where = " catalog_id3 = $_GET[id]";
	}
//	$where .= " and p_sh =1";
	$data2_sql = "select id,member_id,picture,m_type,p_title,p_price,p_baozhuang,catalog_id1,catalog_1,catalog_id2,catalog_3,catalog_id3 from hot_pro where".$where." order by m_type,p_addtime desc";
	
	$data2_rs = mysql_query($data2_sql);

	$data2 = array();
	while($data2_row=mysql_fetch_array($data2_rs))
	{
		$data2[] = $data2_row;
	}

	foreach($data2 as &$v)
	{
		$v['ishot'] = 1;
	}

	$data2 = array_merge($data2,$data);

	$pagesize=15;
	$count = count($data2);
	$pager = '';
	$url = "/hot/".$_GET[type_name]."-cid$_GET[id]-did$_GET[did]-p";

	if($count>$pagesize)
	{
		$pager .= '<div class="page">';

		$p = intval($_GET['p'])?intval($_GET['p']):1;
		$limit = $p*$pagesize;
		$data2 = array_slice($data2,$limit-15,15);
		$pages = intval($count/$pagesize)+1;
		
		$prev = ($p-1)?($p-1):1;
		$next = ($p+1)<=$pages?$p+1:$p;
		
		$pager .= '<a href="'.$url.'1.html">首页</a>&nbsp;';
		$pager .= '<a href="'.$url.$prev.'.html">上一页</a>&nbsp;';

		
					$page = 11;
			$offset = 4;
			$from = $curr_page - $offset;
			$to = $curr_page + $offset;
			if($page >= $pages)
			{
				$from = 2;
				$to = $pages-1;
			}
			else
			{
				if($from <= 1)
				{
					$to = $page-1;
					$from = 2;
				}
				elseif($to >= $pages)
				{
					$from = $pages-($page-2);
					$to = $pages-1;
				}
			}
		for($i = $from; $i <= $to; $i++)
		{
			if($i == $p)
			{
				$pager .= '<strong>'.$i.'</strong>&nbsp;';
			}
			else
			{
				$now_url = $url.$i.".html";
				$pager .= '<a href="'.$now_url.'">'.$i.'</a>&nbsp;';
			}
		}
		
		$pager .= '<a href="'.$url.$next.'.html">下一页</a>&nbsp;';
		$pager .= '<a href="'.$url.$pages.'.html">末页</a>&nbsp;';
		$pager .="</div>";
	}


foreach($data2 as $k=>$val)
{
 if($val['ishot']==1)
 {

	$ec = "http://www.sandib2b.cn/hot/".$val['id'].".html";
	
	
 }
 else
 {
	$ec ="http://www.sandib2b.cn/supply/".$val['id'].".html";
 }

?>

<li>
<?php if($val[m_type]==6){?>
<?php } ?>
<table width="145" height="145" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#EBF0F5">
  <tr>
    <td align="center" valign="middle" style="padding: 6px;"><a href="<?=$ec?>" target="_blank"><?php if(trim($val[picture])){?><img src="http://img.sandib2b.cn/<?=$val[picture]?>" alt="<?=$val[p_title]?>"  border="0" width="145" height="145"/><?php }else{?><img src="/upfile/NoPICB.gif" border="0" width="145" height="145"/><?php }?></a></td>
  </tr>
</table>

<div class="a">
<?php if($val[m_type]==6){?>
    <div style="float: left;height: 40px;width: 25px;">
         <img src="/hot-pro/images/tj.gif" border="0" align="absmiddle" />
	</div>
<?php }?>
    <div style="float: left;text-align: left;width: <?php if($val[m_type]==6){echo "140px";}else{echo "160px";}?>;"><a href="<?=$ec?>" target="_blank"><?=mb_substr($val[p_title],0,18,'utf-8')?></a></div>
</div>
<div align="center"> 
<a href="<?=$ec?>" target="_blank"><img src="/hot-pro/images/hot_icon_01.gif" width="59" height="24" style="border:none" /></a>&nbsp;&nbsp;
<?php
	$m_rs=mysql_query("select m_user from member where id=".$val[member_id]);
	$m_row=mysql_fetch_array($m_rs);
    if($val[m_type]==6){ ?>
	<a href="http://<?=$m_row["m_user"] ?>.sandib2b.cn/contact.htm" target="_blank">
<?php }else { ?>
<a href="http://sandib2b.cn/cn/template/<?=$m_row["m_user"] ?>/contact.html" target="_blank">
<?php } ?>
<img src="/hot-pro/images/hot_icon_02.gif" width="59" height="24" style="border:none" />
</a>
</div>
</li>
<?php }

?>
</ul>
<div class="kuang supp">
<div class="PostTitle"><span><?=$row3['city_name']?><?=$row['hot_name']?>价格</span></div>
<div class="cl"></div>
<div class="EPostlist">
    <ul>
        <li class="dis2"><div align="center">热点产品名称</div></li>
        <li class="dis3"><div align="center">热点产品商家</div></li>
        <li class="dis4">所在地区</li>
        <li class="dis4">商家参考价格 </li>
    </ul>
    <div class="cl"></div>
</div>
<?php
	foreach($data2 as $k=>$val)
	{
	
		
				$rs = "SELECT `m_user`,`m_type`,`m_cname`,`m_pro`,`m_city` FROM `member` WHERE id =".$val['member_id'];
				$query = mysql_query($rs);
				$data=mysql_fetch_array($query);
				
				 if($val['ishot']==1)
				 {
						if($data['m_type']==6)
						{
							$ec = "http://www.sandib2b.cn/hot/".$val['id'].".html";
							$ec1 = "http://".$data['m_user'].".sandib2b.cn/";
						}
						else
						{
							$ec = "http://www.sandib2b.cn/hot/".$val['id'].".html";
							$ec1 = "http://www.sandib2b.cn/cn/template/".$data['m_user']."/";
						}
				}
				 else
				 {
				 		if($data['m_type']==6)
						{
							$ec ="http://www.sandib2b.cn/supply/".$val['id'].".html";
							$ec1 = "http://".$data['m_user'].".sandib2b.cn/";
						}
						else
						{
							$ec ="http://www.sandib2b.cn/supply/".$val['id'].".html";
							$ec1 = "http://www.sandib2b.cn/cn/template/".$data['m_user']."/";
						}
					
				 }
				$str = '';
				
				if($data['m_pro'])
				{
					$str .=  $city[$data['m_pro']]['city_name'];
				}
				if($data['m_city'])
				{
					$str .=  '-'.$city[$data['m_city']]['city_name'];
				}
			
?>
<div class="EPostlist <?php if($i%2==0){?>listBg<?php }?>">
    <ul>
        <li class="dis2"><a href="<?=$ec?>" target="_blank"><?=mb_substr($val['p_title'],0,23,'utf-8')?></a></li>
        <li class="dis3"><a href="<?=$ec1?>" target="_blank"><span><?=$data['m_cname']?></span></a></li>
        <li class="dis4"><?=$str?></li>
        <li class="dis4"><?=$val['p_price']?></li>
    </ul>
    <div class="cl"></div>
</div>
<?php $i++;}?>
<div class="tt2"></div>
</div>
<?=$pager?>
</div>
<div class="w960 topside20 downside20">
<div style="padding-bottom:5px; background-color:#FFFFFF"><div id="adblock1"></div></div>
</div>
<div class="w960 topside20 downside20">
<script type="text/javascript">/*960*90底部，创建于2011-7-6*/ var cpro_id = 'u530503';</script><script src="http://cpro.baidu.com/cpro/ui/c.js" type="text/javascript"></script>
<div class="onl"></div>
</div>
<div id="mian" class="topside6" align="center">
<script type="text/javascript"><!--
google_ad_client = "ca-pub-2924453545159453";
/* 728x90, 创建于 11-3-18 */
google_ad_slot = "0531157620";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<div class="onl"></div>
</div>

<div class="city topside6">
<div class="title1"><div style="float:right"><a href="/hot/<?=$_GET[type_name]?>-city<?=$_GET[id]?>.html" target="_blank">&gt;&gt;更多城市</a></div>城市导航</div>
<ul>
<?php
 $crs=mysql_query("select id,city_name from city where city_id='$row3[city_id]' order by id asc");
 while($crow=mysql_fetch_array($crs)){
?>
<li>
<h1><a href="/hot/<?=$_GET[type_name]?>-cid<?=$_GET[id]?>-did<?=$crow[id]?>.html" target="_blank"><font color="#0033CC"><?=$crow['city_name']?><?=$row['hot_name']?></font></a></h1>
</li>
<?php }?>
</ul>
<div class="onl"></div>
</div>

<div class="w960 topside20 downside20 side">
<script type="text/javascript">/*960*90底部，创建于2011-7-6*/ var cpro_id = 'u530503';</script><script src="http://cpro.baidu.com/cpro/ui/c.js" type="text/javascript"></script>
<div class="onl"></div>
</div>
<?php
include("../inc/foot.php");
?>
</body>
</html>

<script type="text/javascript">/*120*270，创建于2011-3-23*/ var cpro_id = 'u419785';</script><script src="http://cpro.baidu.com/cpro/ui/f.js" type="text/javascript"></script>


<script src="http://www.google.com/jsapi">
</script>
<script type="text/javascript" charset="utf-8">
google.load('ads.search', '2');
</script>
<script type="text/javascript" charset="utf-8">
var pageOptions = {
'pubId' : 'pub-2924453545159453',
'query' : '<?=$row['hot_name']?>'
}
var adblock1 = {
'container' : 'adblock1',
'number' : 3,
'width' : 'auto',
'lines' : 2,
'fontFamily' : 'arial',
'fontSizeTitle' : '14px',
'fontSizeDescription' : '14px',
'fontSizeDomainLink' : '14px'
};
new google.ads.search.Ads(pageOptions, adblock1);
</script>